package com.easy.linkerbuilder;

import java.util.Arrays;
import java.util.Collections;

/**
 * 代码中创建引擎的几个例子
 */
public class ModelBuilder {
    public static BaseRuleModel buildZuiDaModel(){
        BaseRuleModel ruleModel = new BaseRuleModel();
        ruleModel.setName("最大资源网");
        ruleModel.setVersion("2019.12.01/20:21");
        ruleModel.setBaseUrl("http://www.zuidazy2.net");
        ruleModel.setReqCharset("utf-8");
        ruleModel.setHtmlCharset("utf-8");
        ruleModel.setSearchUrl("http://www.zuidazy2.net/index.php?m=vod-search-pg-%page-wd-%keyWords.html");
        ruleModel.setRuleResultList("<li><span class=\"tt\">.*?xing_vb5.*?</li>");
        ruleModel.setRuleResultTitle("target=\"_blank\">(.*?)</a>");
        ruleModel.setRuleResultLinkHeader("http://www.zuidazy2.net");
        ruleModel.setRuleResultLink("<a href=\"(.*?)\"");
        ruleModel.setRuleResultType("xing_vb5\">(.*?)</span>");
        ruleModel.setRuleResultTime("xing_vb6\">(.*?)</span>");
        ruleModel.setRuleDetailCover("<img class=\"lazy\" src=\"(.*?)\"");
        ruleModel.setRuleDetailDesc("<div class=\"vodplayinfo\">(.*?)</div>");
        ruleModel.setRuleDetailListM3u8("<div id=\"play_1\">[\\s\\S]*?</ul>");
        ruleModel.setRuleDetailListShare("<div id=\"play_2\">[\\s\\S]*?</ul>");
        ruleModel.setRuleDetailDownList("<div id=\"down_1\">[\\s\\S]*?</ul>");
        ruleModel.setRuleDetailMain("<li>.*?checkbox.*?</li>");
        ruleModel.setRuleDetailTitle("checked=\"\" />(.*?)\\$");
        ruleModel.setRuleDetailLink("value=\"(.*?)\"");
        ruleModel.setBlockWords(Arrays.asList("福利片","伦理片"));
        return ruleModel;
    }

    public static BaseRuleModel buildBaJieModel(){
        BaseRuleModel ruleModel = new BaseRuleModel();
        ruleModel.setName("八戒资源网");
        ruleModel.setVersion("2019.11.23");
        ruleModel.setBaseUrl("http://bajieziyuan.com");
        ruleModel.setReqCharset("utf-8");
        ruleModel.setHtmlCharset("utf-8");
        ruleModel.setSearchUrl("http://bajieziyuan.com/?m=vod-search-pg-%page-wd-%keyWords.html");
        ruleModel.setRuleResultList("<tr class=\"DianDian\"[\\s\\S]*?</tr>");
        ruleModel.setRuleResultTitle("<td class=\"l\">.*?target=\"_blank\">([\\s\\S]*?)<td>");
        ruleModel.setRuleResultLinkHeader("http://bajieziyuan.com");
        ruleModel.setRuleResultLink("<td class=\"l\"><a href=\"(.*?)\"");
        ruleModel.setRuleResultType("target=\"_blank\">(.*?)</a>");
        ruleModel.setRuleResultTime("(\\d{4}-\\d{2}-\\d{2})");
        ruleModel.setRuleDetailCover("<img src=\"(.*?)\"/>");
        ruleModel.setRuleDetailDesc("<!--简介开始-->(.*?)<!--简介结束-->");
        ruleModel.setRuleDetailListM3u8("<!--前bjm3u8-->[\\s\\S]*?<!--后bjm3u8-->");
        ruleModel.setRuleDetailListShare("<!--前bjyun-->[\\s\\S]*?<!--后bjyun-->");
        ruleModel.setRuleDetailMain("<li>.*?checkbox.*?</li>");
        ruleModel.setRuleDetailTitle("value=\"(.*?)\\$.*?\"");
        ruleModel.setRuleDetailLink("value=\".*?\\$(.*?)\"");
        ruleModel.setBlockWords(Arrays.asList("福利片","伦理片"));
        return ruleModel;
    }

    public static BaseRuleModel buildVodSeeModel(){
        BaseRuleModel ruleModel = new BaseRuleModel();
        ruleModel.setName("卧龙资源网");
        ruleModel.setVersion("2019.11.23");
        ruleModel.setBaseUrl("http://wolongzy.net");
        ruleModel.setReqCharset("utf-8");
        ruleModel.setHtmlCharset("utf-8");
        ruleModel.setSearchUrl("http://wolongzy.net/search.html?page=%page&searchword=%keyWords&searchtype=-1");
        ruleModel.setRuleResultList("<a class=\"videoName\"[\\s\\S]*?</li>");
        ruleModel.setRuleResultTitle("style=\"width:370px;\">([\\s\\S]*?)(&nbsp|</a>)");
        ruleModel.setRuleResultLinkHeader("http://wolongzy.net");
        ruleModel.setRuleResultLink("href=\"(.*?)\"");
        ruleModel.setRuleResultType("<span class=\"category\" >(.*?)</span>");
        ruleModel.setRuleResultTime("(\\d{4}-\\d{2}-\\d{2})");
        ruleModel.setRuleDetailCover("<img src=\"(http://.*?)\">");
        ruleModel.setRuleDetailDesc("<h4>剧情介绍</h4>([\\s\\S]*?)</div>");
        ruleModel.setRuleDetailListM3u8("<h4><div>WLm3u8</div></h4>[\\s\\S]*?>播放协议");
        ruleModel.setRuleDetailListShare("<h4><div>WLyun</div></h4>[\\s\\S]*?>播放协议");
        ruleModel.setRuleDetailMain("<input.*?value=.*?checked>");
        ruleModel.setRuleDetailTitle("value=\"(.*?)\\$");
        ruleModel.setRuleDetailLink("\\$(.*?)\"");
        return ruleModel;
    }

    public static BaseRuleModel buildKuYunModel(){
        BaseRuleModel ruleModel = new BaseRuleModel();
        ruleModel.setName("酷云资源网");
        ruleModel.setVersion("2019.11.25");
        ruleModel.setBaseUrl("http://www.kuyunzy1.com");
        ruleModel.setReqCharset("gb2312");
        ruleModel.setHtmlCharset("gb2312");
        ruleModel.setSearchUrl("http://www.kuyunzy1.com/search.asp?page=%page&searchword=%keyWords&searchtype=-1");
        ruleModel.setRuleResultList("<tr><td colspan=\"5\"[\\s\\S]*?<tr><td colspan=\"5\"");
        ruleModel.setRuleResultTitle("target=\"_blank\">([\\s\\S]*?)</a>");
        ruleModel.setRuleResultLinkHeader("http://www.kuyunzy1.com");
        ruleModel.setRuleResultLink("href=\"(.*?)\"");
        ruleModel.setRuleResultType("<td align=\"center\">[\\s\\S]*?<td align=\"center\">(.*?)</td>[\\s\\S]*?<td align=\"center\">");
        ruleModel.setRuleResultTime("(\\d{4}-\\d{2}-\\d{2})");
        ruleModel.setRuleDetailCover("<img src=\"(.*?)\" alt");
        ruleModel.setRuleDetailDesc("<!--影片介绍开始代码-->([\\s\\S]*?)<!--影片介绍结束代码-->");
        ruleModel.setRuleDetailListM3u8("<h1>来源:kkm3u8</h1>[\\s\\S]*?checkAll");
        ruleModel.setRuleDetailListShare("<h1>来源:kkyun</h1>[\\s\\S]*?checkAll");
        ruleModel.setRuleDetailDownList("<h1>来源:xunlei</h1>[\\s\\S]*?checkAll");
        ruleModel.setRuleDetailMain("<input type='checkbox'[\\s\\S]*?</a>");
        ruleModel.setRuleDetailTitle("<a>(.*?)\\$");
        ruleModel.setRuleDetailLink("\\$(.*?)</a>");
        ruleModel.setBlockWords(Collections.singletonList("伦理片"));
        return ruleModel;
    }

    public static BaseRuleModel buildOkYunModel(){
        BaseRuleModel ruleModel = new BaseRuleModel();
        ruleModel.setName("Ok资源网");
        ruleModel.setVersion("2019.11.26");
        ruleModel.setBaseUrl("http://www.okzyw.com");
        ruleModel.setReqCharset("utf-8");
        ruleModel.setHtmlCharset("utf-8");
        ruleModel.setSearchUrl("http://www.okzyw.com/?m=vod-search-pg-%page-wd-%keyWords.html");
        ruleModel.setRuleResultList("<li><span class=\"tt\">[\\s\\S]*?</li>");
        ruleModel.setRuleResultTitle("target=\"_blank\">([\\s\\S]*?)</a>");
        ruleModel.setRuleResultLinkHeader("http://www.okzyw.com");
        ruleModel.setRuleResultLink("href=\"(.*?)\"");
        ruleModel.setRuleResultType("<span class=\"xing_vb5\">(.*?)</span>");
        ruleModel.setRuleResultTime("<span class=\"xing_vb6\">(.*?)</span>");
        ruleModel.setRuleDetailCover("<img class=\"lazy\" src=\"(.*?)\"");
        ruleModel.setRuleDetailDesc("<span class=\"more\" txt=\"([\\s\\S]*?)</span>");
        ruleModel.setRuleDetailListM3u8("<div id=\"2\">[\\s\\S]*?</ul>");
        ruleModel.setRuleDetailListShare("<div id=\"1\">[\\s\\S]*?</ul>");
        ruleModel.setRuleDetailDownList("<div id=\"down_1\">[\\s\\S]*?</ul>");
        ruleModel.setRuleDetailMain("<li><input type=\"checkbox\"[\\s\\S]*?</li>");
        ruleModel.setRuleDetailTitle("/>(.*?)\\$");
        ruleModel.setRuleDetailLink("value=\"(.*?)\"");
        ruleModel.setBlockWords(Arrays.asList("伦理片","福利片"));
        return ruleModel;
    }

}
